<?php

namespace app\api\validate\user;

use app\api\validate\Validates;

class UserNumber extends Validates
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */	
	protected $rule = [
        'language|语种' => 'require'
    ];
    
    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */	
    protected $message = [];

    /**
     * 定义授权场景验证
     * @return $this
     */
    public function sceneLanguage()
    {
        $stateList = array_keys(config('field.user_number.language.text'));
        return $this->append('language', 'in:'.implode(',', $stateList));
    }
}
